<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>编辑商品</title>
    <link href="${base}/resource/admin/css/common.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="${base}/resource/admin/js/jquery.js"></script>
    <script type="text/javascript" src="${base}/resource/admin/js/jquery.validate.js"></script>
    <script type="text/javascript" src="${base}/resource/admin/editor/kindeditor.js"></script>
    <script type="text/javascript" src="${base}/resource/admin/js/common.js"></script>
    <script type="text/javascript" src="${base}/resource/admin/js/input.js"></script>
    <script type="text/javascript">
        $().ready(function() {
            var $inputForm = $("#inputForm");
             [@flash_message /]
            var $browserButton = $("#browserButton");
            $browserButton.browser();

            $("select[name='universityId']").change(function(){
                var opt=$(this).find("option:selected").text();
                $("input[name='universityName']").val(opt);
            });

        });
    </script>
</head>
<body>
<div class="path">
    <a href="${base}/common/index">首页</a> &raquo;编辑文章
</div>
<form id="inputForm" action="update.do" method="post" class="required-form" onsubmit="return validateForm(this)">
    <input type="hidden" name="id" value="${entity.id}"/>
    <table class="input tabContent">
        <tr>
            <th>
                <span class="requiredField">*</span>院校:
            </th>
            <td>
                <select name="universityId" class="text required">
                    <option value="0" disabled="disabled">空</option>
                [#list universityList as university]
                    <option value="${university.id}" [#if entity.universityId=university.id] selected=selected[/#if]>${university.name}</option>
                [/#list]
                </select>
                <input type="hidden" name="universityName" value="${entity.universityName}"/>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>用户
            </th>
            <td>
                <input type="hidden" name="member.id" value="${entity.member.id}"/>
                ${entity.member.username} ${entity.member.username} <a href="/member/edit?id=${entity.member.id}">[查看]</a>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>名称
            </th>
            <td>
                <input type="text" name="name" class="text required" maxlength="100" value="${entity.name}" />
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>插图
            </th>
            <td>
                <span class="fieldSet">
						<input type="text" id="img" name="image" class="text valid" value="${entity.image}" maxlength="200">
						<input type="button" id="browserButton" class="button" value="选择文件">
					</span>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>价格
            </th>
            <td>
                <input type="text" name="price" class="text" maxlength="100" value="${entity.price}" />
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>联系电话
            </th>
            <td>
                <input type="text" name="contactMobile" class="text" maxlength="100" value="${entity.contactMobile}" />
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>联系人
            </th>
            <td>
                <input type="text" name="contactPerson" class="text" maxlength="100" value="${entity.contactPerson}" />
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>置顶
            </th>
            <td>
                <label>
                    <input type="checkbox" name="isTop" value="true" [#if entity.isTop] checked="checked"  [/#if]/>置顶
                </label>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>上架
            </th>
            <td>
                <label>
                    <input type="checkbox" name="isPublication" value="true"  [#if entity.isMarketable] checked="checked"  [/#if] />发布
                </label>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>展出
            </th>
            <td>
                <label>
                    <input type="checkbox" name="isList" value="true"  [#if entity.isList] checked="checked"  [/#if] />发布
                </label>
            </td>
        </tr>

        <tr>
            <th>
                <span class="requiredField">*</span>备注
            </th>
            <td>
                <span class="fieldSet">
				    <input type="text" name="memo" class="text" maxlength="100" style="width: 500px;" value="${entity.memo}"/>
                    <span style="color: #cc0000;">30个汉字以内的简短描述</span>
                </span>
            </td>
        </tr>
        <tr>
            <th>
                <span class="requiredField">*</span>内容:
            </th>
            <td>
                <textarea id="editor" name="description" class="editor" style="width: 100%;">${entity.description}</textarea>
            </td>
        </tr>
        <tr>
            <th>
                &nbsp;
            </th>
            <td>
                <input type="submit" class="button" value="提交" />
                <input type="button" class="button" value="返回" onclick="location.href='list.do'" />
            </td>
        </tr>
    </table>
</form>
</body>
</html>